<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/core/common/top.jsp" %>
<script src="${ctx}/core/scripts/jquery_last.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidator.js" type="text/javascript" charset="UTF-8"></script>
<script src="${ctx}/core/scripts/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<html>
	<head>
		<title></title>
		<meta http-equiv="Pragma" content="no-cache">
		<meta http-equiv="Cache-Control" content="no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0">
		<meta http-equiv="Expires" content="0">	
		<script>
			$(document).ready(function(){
				$.formValidator.initConfig({formid:"form0",tidymode:true,onerror:function(msg) {showMessage(msg);}});
				$("#contact").formValidator().inputValidator({min:1,onerror:"联系人为必填项！"});
				$("#name").formValidator().inputValidator({min:1,max:50,onerror:"名称为必填项",onerrormax:"名称超出50个字符"});
				$("#telphone").formValidator().inputValidator({min:7,max:11,onerror:"电话为必填项",onerrormin:"电话少于8位",onerrormax:"电话多于11位"});
				$("#status").formValidator().inputValidator({min:1,onerror:"状态为必选项"});
				$("#city").formValidator().inputValidator({min:1,onerror:"城市为必填项"});
				$("#region").formValidator().inputValidator({min:1,onerror:"区域为必填项"});
				$("#address").formValidator().inputValidator({min:1,onerror:"地址为必填项"});
				$("#positionX").formValidator().inputValidator({min:1,onerror:"经度为必填项"});
				$("#positionY").formValidator().inputValidator({min:1,onerror:"纬度为必填项"});
				$("#uploadFile").formValdator().inputValidator({min:1,onerror:"请选择图片文件！"});
			});

			function uploadImage(){
				//this.mainform.action="baseInfoManage.action&act=submitImage";
				//enctype="multipart/form-data"
				var act=document.getElementById("act");
				//alert(act.value);
				act.value="submitImage";
				this.mainform.submit();
			}

			function doDelete(id){
				//alert(id);
				if(confirm("你确定要删除该图片？")){
					var act=document.getElementById("act");
					var hiddenId=document.getElementById("hiddenId");
					//alert(hiddenId);
					hiddenId.value=id;
					//alert(act.value);
					act.value="deleteImage";
					this.mainform.submit();
				}
			}
		</script>
	</head>
	<body>
		<form id="form0" action="${ctx}/platformManage/baseInfoManage.action" method="post" name="mainform"  >
			<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0" valign="top">
				<%@include file="/WEB-INF/core/common/message.jsp"%>
				<tr width="100%">
					<td>
						<table border="0" align="center" cellpadding="0" cellspacing="0">
							<tr width="100%">
								<td width="8" height="27" align="left"><img src="${ctx}/core/images/button_05.gif" width="8" height="27" /></td> 
		    					<td width="99%"  align="left" background="${ctx}/core/images/button_06.gif" class="bluecu">&nbsp;<img src="${ctx}/core/images/icon_04.gif" />&nbsp;我的信息管理</td>
		    					<td width="8" align="right"><img src="${ctx}/core/images/button_07.gif" width="8" height="27" /></td>
		    				</tr>
		    			</table>
		    		</td>
		  		</tr>
				<tr>
					<td colspan="3" class="biaoge"  valign="top">
						<table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
							
							<tr align="left">
								<td width="10%" height="30" nowrap="nowrap" bgcolor="#DDE4EA" align="left">&nbsp;&nbsp;名称<font color="red"></font></td>
        						<td width="40%" height="30" bgcolor="#DDE4EA" align="left">
        							<s:property value="info.name"/>
        						</td>

        						<td width="10%" height="30" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;类型<font color="red"></font></td>
		        				<td nowrap width="40%" bgcolor="#DDE4EA" align="left">
		        					<exts:select id="type" name="info.type" value="%{info.type}" pageState="view" exclude="0" code="BASEINFO_TYPE" ></exts:select>
							    </td>								

      						</tr>						

						
					        <tr align="left">    							
						        <td height="25" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;等级<font color="red"></font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<exts:textfield id="level" name="info.level" value="%{info.level}" pageState="view"  class="textbox_css" style="width:150px"/>
								</td>
								
								<td height="25" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;点数<font color="red"></font></td>
						        <td  bgcolor="#DDE4EA" nowrap align="left" >
						        	<exts:textfield id="ratio" name="info.ratio" value="%{info.ratio}" pageState="view"  class="textbox_css" style="width:150px"/>
								</td>
								
						        
							</tr>
							
							<tr align="left">
      							
						        
								<td bgcolor="#DDE4EA" height="25" nowrap align="left">&nbsp;&nbsp;状态<font color="red"></font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left" colspan=3>
						        	<exts:select id="status" name="info.status" value="%{info.status}" pageState="view" exclude="0" code="BASEINFO_STATUS" ></exts:select>
								</td>

							</tr>
							
							<tr align="left">
      							
						        <td height="25" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;城市&nbsp;<font color="red"></font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<exts:textfield id="city" name="info.city" value="%{info.city}" pageState="view"  class="textbox_css" style="width:150px"/>
								</td>
								
						        <td bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;区域<font color="red"></font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<exts:textfield id="region" name="info.region" value="%{info.region}" pageState="view"  class="textbox_css" style="width:150px"/>
								</td>
							</tr>
							
							 <tr align="left">
      							
						        <td height="25" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;经度<font color="red"></font></td>
						        <td  height="25" bgcolor="#DDE4EA" nowrap align="left">
						        	<exts:textfield id="positionX" name="info.positionX" value="%{info.positionX}" pageState="view"  class="textbox_css" style="width:150px"/>
						        							        	
								</td>
								
						        <td bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;纬度<font color="red"></font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<exts:textfield id="positionY" name="info.positionY" value="%{info.positionY}" pageState="view"  class="textbox_css" style="width:150px"/>
								</td>
							</tr>	
							
							<tr align="left">
      							<td height="3px" bgcolor="#C7C7E2" align="left" colspan=3></td>
      							<td height="3px" bgcolor="#C7C7E2" align="left" colspan=3></td>
						        
							</tr>
							
							
							<tr align="left">
      							
      							<td height="30" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;联系人<font color="red">*</font></td>
						        <td height="30" bgcolor="#DDE4EA" nowrap align="left">
						        	<exts:textfield id="contact" name="info.contact" value="%{info.contact}" pageState="%{pageState}" class="textbox_css" style="width:150px"/>
								</td>
						       								
						        <td bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;手机</td>
						        <td bgcolor="#DDE4EA" nowrap align="left">
						        	<exts:textfield id="mobile" name="info.mobile" value="%{info.mobile}" pageState="%{pageState}"   class="textbox_css" style="width:150px"/>
								</td>
							</tr>
							
							<tr align="left">
      							<td height="25" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;前台电话<font color="red">*</font></td>
						        <td bgcolor="#DDE4EA" nowrap align="left" colspan=3>
						        	<exts:textfield id="telphone" name="info.telphone" value="%{info.telphone}" pageState="%{pageState}"  class="textbox_css" style="width:450px"/><font color="#BEBEBE">(多个电话请用逗号分隔)</font>
								</td>
							</tr>
						
	
							

						
												
							<tr align="left">							   
							    <td height="25" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;详细地址<font color="red">*</font></td>
							    <td bgcolor="#DDE4EA" nowrap align="left" colspan=3>
							    	<exts:textfield id="address" name="info.address" value="%{info.address}" pageState="%{pageState}"  class="textbox_css" style="width:450px"/><font color="#BEBEBE">(地址请尽量详细)</font>
								</td>

							</tr>
							
							<tr align="left">							   
							    <td height="30" bgcolor="#DDE4EA" nowrap align="left">&nbsp;&nbsp;图片<font color="red">*</font></td>
							    <td bgcolor="#DDE4EA" nowrap align="left" colspan=3>
							    	<table width="100%" border="0" cellpadding="0" cellspacing="1" bordercolor="#FFFFFF">
							    		<tr>
									    	<td height="30" bgcolor="#DDE4EA" nowrap align="left">
										    	<input type="file" id="uploadFile" name="uploadFile" size="40" ></input>
												<input type="button" name="uploadFile1" class="btn" value="上传" onclick="uploadImage();"></input>
									    	</td>
								    	</tr>
								    	
								    	<tr>
								    		<td>
								    			<table width="100%" border="0" cellpadding="2" cellspacing="2" bordercolor="#FFFFFF">
								    				<tr valign="bottom">
								    				<s:set name="rowIndex" value="1"/>
								    				<s:iterator value="info.imageInfos" id="im">
								    					<s:if test="#rowIndex==6">
								    						</tr><tr>
								    						<s:set name="rowIndex" value="1"/>
								    					</s:if>
								    					<td height="170" width="170" bgcolor="#DDE4EA" nowrap align="center">
												    		<img height="160" width="160" src="${ctx}\<s:property value='#im.url'/>"/>
												    		<a href="javascript:doDelete('<s:property value="#im.id"/>')"><img src="${ctx}/core/images/del.gif" name="icon_074" width="16" height="16" border="0" id="icon_074" style="CURSOR: hand" title="删除"/></a>
												    	</td>
												    	
												    	<s:set name="rowIndex" value="#rowIndex+1"/>
													 </s:iterator>	
								    				</tr>
								    			</table>
								    		
								    		</td>
								    	</tr>
								    </table>
							    
							    	
							    </td>
							</tr>							
      					   	


							<tr>
								<td height="10" colspan="4" background="../core/images/line5.gif">&nbsp;</td>
							</tr>
							<tr>
								<td height="25" colspan="4" align="center">
									   	<input id="act" name="act" type="hidden" value="submitMyInfo"/>
							        	<input name="info.baseId" type="hidden" value="<s:property value='info.baseId'/>"/>
							        	<input name="info.name" type="hidden" value='<s:property value="info.name"/>'/>
							        	<input name="info.level" type="hidden" value="<s:property value='info.level'/>"/>
							        	<input name="info.ratio" type="hidden" value="<s:property value='info.ratio'/>"/>
							        	<input name="info.city" type="hidden" value="<s:property value='info.city'/>"/>
							        	<input name="info.region" type="hidden" value="<s:property value='info.region'/>"/>
							        	<input name="info.positionX" type="hidden" value="<s:property value='info.positionX'/>"/>
							        	<input name="info.positionY" type="hidden" value="<s:property value='info.positionY'/>"/>
							        	
							       		<input name="id" id="hiddenId" type="hidden"/> 
										<input id="saveButton" type="submit" class="btn" value="<s:text name='button.save'/>"/>									  
							        <input id="returnButton" type="button" class="btn" value="<s:text name='button.return'/>" onclick="history.go(-1)"/>
								</td>
							</tr>
						</table>
    				</td>
				</tr>
			</table>
		</form>
	</body>
</html>